/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.discount.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 打折信息管理Entity
 * @author czp
 * @version 2018-07-08
 */
@Table(name="discount_discount_info", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="user_id", attrName="userId", label="用户名"),
		@Column(name="brand_id", attrName="brandId", label="品牌名"),
		@Column(name="mall_id", attrName="mallId", label="商场名"),
		@Column(name="shop_id", attrName="shopId", label="商店名"),
		@Column(name="start_date", attrName="startDate", label="开始日期"),
		@Column(name="end_date", attrName="endDate", label="结束日期"),
		@Column(name="discount", attrName="discount", label="折扣信息"),
		@Column(name="photo_path", attrName="photoPath", label="相关图片"),
		@Column(name="intro", attrName="intro", label="说明"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class DiscountDiscountInfo extends DataEntity<DiscountDiscountInfo> {
	
	private static final long serialVersionUID = 1L;
	private String userId;		// 用户名
	private String brandId;		// 品牌名
	private String mallId;		// 商场名
	private String shopId;		// 商店名
	private Date startDate;		// 开始日期
	private Date endDate;		// 结束日期
	private String discount;		// 折扣信息
	private String photoPath;		// 相关图片
	private String intro;		// 说明
	
	public DiscountDiscountInfo() {
		this(null);
	}

	public DiscountDiscountInfo(String id){
		super(id);
	}
	
	@NotBlank(message="用户名不能为空")
	@Length(min=0, max=64, message="用户名长度不能超过 64 个字符")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@NotBlank(message="品牌名不能为空")
	@Length(min=0, max=64, message="品牌名长度不能超过 64 个字符")
	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}
	
	@NotBlank(message="商场名不能为空")
	@Length(min=0, max=64, message="商场名长度不能超过 64 个字符")
	public String getMallId() {
		return mallId;
	}

	public void setMallId(String mallId) {
		this.mallId = mallId;
	}
	
	@Length(min=0, max=64, message="商店名长度不能超过 64 个字符")
	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="开始日期不能为空")
	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="结束日期不能为空")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	@NotBlank(message="折扣信息不能为空")
	@Length(min=0, max=64, message="折扣信息长度不能超过 64 个字符")
	public String getDiscount() {
		return discount;
	}

	public void setDiscount(String discount) {
		this.discount = discount;
	}
	
	@Length(min=0, max=255, message="相关图片长度不能超过 255 个字符")
	public String getPhotoPath() {
		return photoPath;
	}

	public void setPhotoPath(String photoPath) {
		this.photoPath = photoPath;
	}
	
	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}
	
}